
import java.io.IOException;
import java.util.StringTokenizer;

class Main{

	public static String addReverse(String a, String b) {
		if (a.length() < b.length()) {
			return addReverse(b, a);
		} else {
			String answer = "";
			int carry = 0;
			int sum;
			for (int i = 0; i < a.length(); i++) {
				sum = carry + (a.charAt(i) - '0');
				if (i < b.length()) {
					sum += b.charAt(i) - '0';
				}
				answer += sum % 10;
				carry = sum / 10;
			}
			return answer + (carry > 0 ? carry : "");
		}
	}

	public static void main(String[] args) throws IOException {
		java.io.BufferedReader r = new java.io.BufferedReader(
				new java.io.InputStreamReader(System.in));

		int number = Integer.parseInt(r.readLine());
		for (int i = 0; i < number; i++) {
			String s = r.readLine();
			StringTokenizer tokenizer = new StringTokenizer(s);

			String a = tokenizer.nextToken();
			String b = tokenizer.nextToken();
			System.out.println(Integer.parseInt(addReverse(a, b)));
		}
	}
}
